home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / ms.zip / ARCINTRO.CHP < prev    next >
Text File  |  1993-06-15  |  6KB  |  176 lines

  1. %
  2. #EF
  3. #TProgramming Object Oriented Arcade Games In Turbo C
  4. #HS,1,1,80,25,11,1
  5. #AL,1,13,1
  6. ~W~IIntroduction~Y~I
  7. #W
  8. %
  9. #EF
  10. #TIntroduction    Pg. 1
  11. #HS,1,1,80,25,11,1
  12. #C4,R5
  13.                             ~W~IA Note From The Author~Y~I
  14.  
  15.  
  16. I like computer graphics. I like it a lot. The visual satisfaction that I
  17. get from implementing graphically-oriented systems is hard to describe to
  18. anyone that hasn't done it. There are quite a few people around that are
  19. just like me. That's one of the reasons that so many people write games.
  20. #WN
  21.  
  22. If you've never written a game you may not know this, but the same
  23. principles that are used to implement games are used in high-powered
  24. graphics systems such as commercial flight simulators. Even something
  25. as exotic as the symbology on a jet fighter display is controlled and
  26. animated in the same ways that animation is done in games. Once you
  27. become familiar with the basic concepts, you can produce a wide variety
  28. of systems from simple games to aerospace applications.
  29. #WP
  30. %
  31. #EF
  32. #TIntroduction    Pg. 2
  33. #HS,1,1,80,25,11,1
  34. #C4,R5
  35. ~Y~I
  36.  
  37. When I decided to write a game, I looked and looked for a book that would
  38. give me an in-depth explanation of the principles of animation and
  39. simulation. Much of what was available either took a Phd. in Computer
  40. Science to be able to understand, or it was such a hodge-podge of
  41. implementation-specific code that it wasn't any real help. And that's where
  42. the idea for this ~W~Ibook~Y~I came from.
  43.  
  44. #WN
  45. Although this isn't a traditional way to publish a book, this is a book
  46. nonetheless. Unlike normal printed book, this book is ~R~Iinteractive~Y~I.
  47. It's like having a personal tutor to teach you how to write games.
  48.  
  49. #WN
  50. My objectives for this text are 1) to give you as the reader a clear
  51. picture of how to animate objects on a computer screen, 2) to explain and
  52. demonstrate how to produce libraries of highly reusable graphic objects,
  53. and 3) to show how you might pull what you know into viable game programs.
  54.  
  55. #WP
  56. %
  57. #EF
  58. #TIntroduction    Pg. 3
  59. #HS,1,1,80,25,11,1
  60. #C4,R5
  61. ~Y~I
  62.  
  63. You will notice as you read through this book that I stress modular design
  64. and development. I use ~W~Iinformation hiding~Y~I (I'll explain what I mean
  65. by information hiding in Chapter 5) as much as I can without sacrificing
  66. performance. I would encourage you to use well-structured, modular design
  67. techniques for your games. A successful game can spawn sequels. If your
  68. game is well designed, you will probably be able to re-use a lot of your
  69. code. In computing, we often talk about not re-inventing the wheel, but
  70. you'd be surprised how few times we take steps to prevent ourselves from
  71. having to do exactly that.
  72.  
  73. #WN
  74. You'll see in the example game that structured design and development is
  75. something of a mania with me. I've been doing design and development for
  76. about nine years now, both while working for companies and as a freelance
  77. contract programmer. Nowadays I'm running my own consulting company and
  78. teaching computer programming at the college level. All of my experience
  79. has taught me that structured design and development is one of the most
  80. basic ways of producing high quality code.
  81. #WP
  82.  
  83. %
  84. #EF
  85. #TIntroduction    Pg. 4
  86. #HS,1,1,80,25,11,1
  87. #C4,R5
  88. ~Y~I
  89.  
  90. Since the code in this book is for instructional purposes, I've tried to
  91. make it as clear and straightforward as possible. In some cases I've
  92. sacrificed a little speed to gain readability. It will run fast enough
  93. for almost any game you want to use it in. But if you're writing a
  94. heavy-duty application and you're familiar enough with C to be able
  95. optimize the code, please feel free to do so.
  96.  
  97. #WN
  98. Normally, when I write code, I document it extensively with file and
  99. function banners, as well as liberal amounts of comments. A file banner
  100. is a formalized banner of comments at the beginning of the file telling
  101. what sort of functions are in that particular file. A function banner is
  102. a comment banner that gives the name of the function, explains what the
  103. function does (and probably also tells how it is done), documents all
  104. information that goes in, and explains all of the information that comes
  105. out.
  106.  
  107. #WP
  108. %
  109. #EF
  110. #TIntroduction    Pg. 5
  111. #HS,1,1,80,25,11,1
  112. #C4,R5
  113. ~Y~I
  114.  
  115. In this book, I have omitted almost all of that from the code. That's
  116. because the one of the purposes of the book is to document the code. When
  117. you produce games on your own, I would encourage you to document the code
  118. as thoroughly as possible.
  119.  
  120. #WN
  121. My hope in writing this book is that you will use the fundamentals I
  122. explain here to build yourself a library of highly re-usable code that
  123. will enable you to quickly put together any sort of game you want to.
  124. After all, that's the only way to make any real money at it.
  125.  
  126. #WN
  127. Good Luck,
  128.  
  129. #WN
  130. |Dave Conger|
  131. #WP
  132. %
  133. #EF
  134. #TIntroduction    Pg. 6
  135. #HS,1,1,80,25,11,1
  136. #C4,R5
  137.                         ~W~IWhat You Need To Use This Book
  138.  
  139. ~Y~ITo get full utilization from this book and the code in it, you will need
  140. the following:
  141.  
  142. ~C~IHardware~Y~I
  143. An MS DOS compatible computer with one of the following graphics cards (or
  144. a card compatible with one of the following) EGA, VGA, SVGA.
  145.  
  146. #WN
  147. ~C~ISoftware~Y~I
  148. IBM PC DOS (available from IBM) or MS DOS (available from Microsoft Corp.)
  149. version 2.0 or later, and TURBO C (by Borland International) version 2.0 or
  150. later. TURBO C++ version 2.0 or later can be used as well.
  151.  
  152. #WN
  153. If you don't have TURBO C, don't despair. You can still use most of this
  154. code with other C compilers, with minor modifications. The reason that
  155. TURBO C was chosen for this project is that the Borland Graphics Interface
  156. (BGI) provided with TURBO C is especially well suited to writing programs
  157. that can support a wide variety of video adapters.
  158. #WP
  159. %
  160. #EF
  161. #TIntroduction    Pg. 7
  162. #HS,1,1,80,25,11,1
  163. #C4,R5
  164. ~Y~I
  165. By the way, from time to time you'll see the symbol ~W~Iā”‚ā”‚ ~Y~Iin the example
  166. code. This is a logical or. Normally we use a pair of pipe symbols (ASCII
  167. character #124) for logical or. However, the authoring system I used to
  168. produce this tutorial uses that symbol for something else. Therefore, I
  169. wasn't able to put it in the code.
  170.  
  171. Of course, all source code in this tutorial is in the .C and .H files
  172. that come with it. In the source files a pair of character 124's is used.
  173. So you should have no trouble compiling the accompanying source files.
  174.  
  175. #WP
  176. #X